/*
 * @copyright fxsen <br/>
 * @date 2022/4/24 19:15 <br/>
 * @email <a href="mailto:fxsen@foxmail.com">
 * @author fxsen
 */
package com.fxsen.commons.sysmanager.core.entity;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fxsen.commons.core.base.common.entity.BaseEntity;
import com.gitee.sunchenbin.mybatis.actable.annotation.Column;
import com.gitee.sunchenbin.mybatis.actable.annotation.TableComment;
import com.gitee.sunchenbin.mybatis.actable.constants.MySqlTypeConstant;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import javax.persistence.Entity;

/**
 * @author fxsen
 * @date 2022/4/24 19:15
 * @email <a href="mailto:fxsen@foxmail.com">
 */
@ApiModel("本地存储")
@TableName("tool_local_storage")
@TableComment(value = "本地存储表")
@Entity
public class LocalStorage extends BaseEntity {

    private static final long serialVersionUID = 8231947775716131484L;
    @ApiModelProperty(value = "关联的业务ID")
    @TableField(value = "owner_id")
    @Column(name = "owner_id", type = MySqlTypeConstant.VARCHAR, comment = "关联的业务ID",length = 32)
    private String ownerId;

    @ApiModelProperty(value = "关联的业务类型")
    @TableField(value = "owner_category")
    @Column(name = "owner_category", type = MySqlTypeConstant.VARCHAR, comment = "关联的业务类型",length = 255)
    private String ownerCategory;

    @ApiModelProperty(value = "真实文件名")
    @TableField(value = "real_name")
    @Column(name = "real_name", type = MySqlTypeConstant.VARCHAR, comment = "真实文件名",length = 255)
    private String realName;

    @ApiModelProperty(value = "文件名")
    @TableField(value = "name")
    @Column(name = "name", type = MySqlTypeConstant.VARCHAR, comment = "文件名",length = 255)
    private String name;

    @ApiModelProperty(value = "后缀")
    @TableField(value = "suffix")
    @Column(name = "suffix", type = MySqlTypeConstant.VARCHAR, comment = "后缀",length = 50)
    private String suffix;

    @ApiModelProperty(value = "路径")
    @TableField(value = "path")
    @Column(name = "path", type = MySqlTypeConstant.VARCHAR, comment = "路径",length = 255)
    private String path;

    @ApiModelProperty(value = "查看路径")
    @TableField(value = "view_path")
    @Column(name = "view_path", type = MySqlTypeConstant.VARCHAR, comment = "真实路径",length = 255)
    private String viewPath;

    @ApiModelProperty(value = "类型")
    @TableField(value = "type")
    @Column(name = "type", type = MySqlTypeConstant.VARCHAR, comment = "类型",length = 20)
    private String type;

    @ApiModelProperty(value = "大小")
    @TableField(value = "size")
    @Column(name = "size", type = MySqlTypeConstant.VARCHAR, comment = "大小",length = 255)
    private String size;
    public LocalStorage(){
        super();
    }
    public LocalStorage(String realName,String name, String suffix, String path, String viewPath,String type, String size) {
        this.realName = realName;
        this.name = name;
        this.suffix = suffix;
        this.path = path;
        this.viewPath = viewPath;
        this.type = type;
        this.size = size;
    }
    public void copy(LocalStorage source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }

    public String getOwnerId() {
        return ownerId;
    }

    public void setOwnerId(String ownerId) {
        this.ownerId = ownerId;
    }

    public String getOwnerCategory() {
        return ownerCategory;
    }

    public void setOwnerCategory(String ownerCategory) {
        this.ownerCategory = ownerCategory;
    }

    public String getRealName() {
        return realName;
    }

    public void setRealName(String realName) {
        this.realName = realName;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getSuffix() {
        return suffix;
    }

    public void setSuffix(String suffix) {
        this.suffix = suffix;
    }

    public String getPath() {
        return path;
    }

    public void setPath(String path) {
        this.path = path;
    }

    public String getViewPath() {
        return viewPath;
    }

    public void setViewPath(String viewPath) {
        this.viewPath = viewPath;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getSize() {
        return size;
    }

    public void setSize(String size) {
        this.size = size;
    }
}
